package com.wuhao.jdqlib.db

import android.view.View
import androidx.databinding.BindingAdapter


object DataBindingComponent {

    /**
     * 隐藏控件
     * @param isVisible 当为true则显示[View.VISIBLE], 否则隐藏[View.INVISIBLE]
     */
    @BindingAdapter("invisible")
    @JvmStatic
    fun setVisibleOrInvisible(v: View, isVisible: Boolean) {
        v.visibility = if (isVisible) {
            View.VISIBLE
        } else {
            View.INVISIBLE
        }
    }

}